The present invention relates to an MPEG encoder for compressing a moving picture.
MPEG standards are known as international video compression standards issued by Moving Picture Experts Group. In accordance with these standards, each of the frames representing a moving picture is classified as an I, P or B frame. An I-frame stands for an intra-coded frame, which is also called an xe2x80x9cintra framexe2x80x9d. A P-frame is an abbreviation of a predictively coded frame, which is also called a xe2x80x9cpredicted framexe2x80x9d. And a B-frame means a bidirectionally coded frame, which is also called a xe2x80x9cbidirectionally predicted framexe2x80x9d. The mode of coding applicable to a picture, or the type of macroblocks included in the picture, is determined depending on the type of the picture, i.e., I, P or B. Specifically, macroblocks in an I-frame are processed in an intra-frame coding mode. Macroblocks in a P-frame are coded in an intra-frame coding mode or in a forward inter-frame predictive coding mode with or without motion compensation. One of these coding modes is selected for the P-frame to minimize a prediction error. And macroblocks in a B-frame are coded in an intra-frame coding mode or in a forward, backward or bidirectional inter-frame predictive coding mode. As for the B-frame, one of these coding modes is also selected to minimize a prediction error. It should be noted that the predictive coding modes for B-frames all require motion compensation. Each macroblock is composed of 16xc3x9716 pixels.
According to the conventional video compression technique, a coding mode is selected for each macroblock without taking the coding modes of other macroblocks into account. Thus, even a pair of closely correlated macroblocks (which may belong to either two different frames or a single frame) may be coded in mutually different modes due to noise superimposed on a frame, for example. This is one of the factors that might deteriorate the quality of image data when a compressed version of the data is decoded.
It is therefore an object of the present invention to avoid such deterioration in image quality by modifying an algorithm for determining a coding mode.
To achieve this object, the present invention determines the coding mode for each block in a current frame in conjunction with either the coding mode(s) of at least one block in another frame compressed or the coding mode(s) of at least one other block in the current frame. In this manner, the same coding mode will be applied to two closely correlated blocks.